import React, { Component } from 'react'

export default class List extends Component {
    state = {
        students: [
            {name:'小明',score:99},
            {name:'小红',score:99},
            {name:'小刚',score:92},
            {name:'小华',score:60},
        ]
    }
    render() {

        const dataDom = this.state.students.map((item)=>{
            return (
                <li>姓名: {item.name} &nbsp;&nbsp; 成绩: {item.score} &nbsp;&nbsp; 评分: { item.score > 80 ? '优秀':'合格' } </li>
            )
        })

        return (
            <div>
                <ul>
                    { dataDom }
                </ul>
            </div>
        )
    }
}
